package com.bao.work.work02;

import java.util.ArrayList;
import java.util.Scanner;

/**
 * @author baoye
 * @date 2024-07-30/18:44
 */
public class Main {
    public static final Scanner INPUT=new Scanner(System.in);
    public static void main(String[] args) {
        ArrayList<Student> students=new ArrayList<>();

        while(true){
            System.out.print("选择(1.录入,0.退出):");
            if(INPUT.nextInt()==1){
                System.out.print("姓名:");
                String name=INPUT.next();
                System.out.print("年龄:");
                Integer age=INPUT.nextInt();
                students.add(new Student(name,age));
            }else{
                break;
            }
        }
        students.forEach(System.out::println);
    }
}
